/**
 * 文件驱动器
 * @version 1.0.0
 */
class FsDriver {
    save(key, value) {
        localStorage.setItem(key, value);
    }
    get(key, defaultValue = null) {
        return localStorage.getItem(key) || defaultValue;
    }

    saveJSON(key, jsonValue) {
        localStorage.setItem(key, JSON.stringify(jsonValue));
    }

    getJSON(key, defaultValue = null) {
        return JSON.parse(localStorage.getItem(key)) || defaultValue;
    }
}

export default FsDriver;